package ar.com.ford.it.fullEconomics.persistence.dao.query;

import oracle.toplink.expressions.Expression;
import oracle.toplink.expressions.ExpressionBuilder;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesc02Coststvers;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesc03Subcoststr;
import com.ford.it.persistence.impl.toplink.CustomExpressionFactory;

public class SubCostStrHierarchyFindBySonQuery implements
        CustomExpressionFactory {

    public Expression createExpression(ExpressionBuilder builder,
                                       Object[] parameters) {
        Expression exp = null;
        Teesc03Subcoststr subCostStr = (Teesc03Subcoststr) parameters[0];
        Teesc02Coststvers subCostStrVersion = (Teesc02Coststvers) parameters[1];
        
        exp = builder.get("teesc03Subcoststr2").equal(subCostStr);
        exp = exp.and(builder.get("teesc02Coststvers").equal(subCostStrVersion));
        
        return exp;
    }

}
